import json
import random

if __name__ == '__main__':
    with open("train.json", "r", encoding="utf-8") as f:
        a = json.load(f)
    random.shuffle(a)
    i = 0
    for item in a:
        item["id"] = str(i)
        i += 1
    with open("train.json", "w", encoding="utf-8") as f:
        json.dump(a, f)
